﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using DAL;
using DTO;



namespace BLL
{
    public partial class BLsupervisor
    {
        ImportToDataBase import = new ImportToDataBase();
        GetData get = new GetData();
        UpdateData update = new UpdateData();

        public List<CallAgentEntity> GetListCAandTask(int RegionID)
        {
            return get.GetListCAandTask(RegionID);
        }

        public List<SourceEntity> loadSourceKPI(DateTime startdate, DateTime enddate)
        {
            var query = (from c in get.loadSource(startdate, enddate)
                         orderby c.ImportDate ascending
                         select new SourceEntity
                         {
                             Source_ID = c.Source_ID,
                             SourceName = c.HCPDate
                         });

            return query.ToList();
        } 

        public List<TaskListEntity> LoadTaskList(int UserID)
        {
            return get.LoadTaskList(UserID);
        }

        public void TransferTask(long CustomerID, int OldUserID, int NewUserID)
        {
            update.UpdateTaskList(CustomerID, OldUserID, NewUserID);
        }

        public void UpdateKPIList(List<CustomerEntity> KPIList)
        {
            update.UpdateKPIList(KPIList);
        }
    
    }
}